<?php
header("Access-Control-Allow-Origin: *");  
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");  
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
$servername = "127.0.0.1:3306";  
$username = "root";  
$password = "397142";  
$dbname = "backdata";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {  
  die("连接失败：" . $conn->connect_error);  
}